<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link rel="stylesheet" type="text/css" href="http://unpkg.com/iview/dist/styles/iview.css">
    <script type="text/javascript" src="http://v1.vuejs.org/js/vue.min.js"></script>
    <script type="text/javascript" src="http://unpkg.com/iview@1.0.1/dist/iview.min.js"></script>
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
    <style>
     .kaiguan{
         text-align: center;
     }
    
    </style>
</head>

<body>
    <div id="app">
            <Tabs :animated="false">
                    <Tab-pane label="一个开关"><div class="kaiguan">
                            <Switch @on-change="kaiguan">
                                    <span slot="open">开</span>
                                    <span slot="close">关</span>
                                </Switch>
                    </div></Tab-pane>
                    <Tab-pane label="标签二">标签二的内容</Tab-pane>
                    <Tab-pane label="标签三">标签三的内容</Tab-pane>
            </Tabs>
            <h1>{{message}}</h1>
    </div>
</body>

<script>
    var vm = new Vue({
        el:'#app',
        data:{
            message:null
        },
        methods:{
            kaiguan(event){
                axios.post('http://localhost:3000/isWorking',{
                isworking:event
             }).then(res=>{
                 console.log(res);
                 this.message=res.data.message
                
             })
                
            }
        }
    })
</script>

</html>